<?php

namespace app\admin\controller;

use app\admin\model\User;
use app\common\controller\Backend;
use think\Config;

/**
 * 控制台
 *
 * @icon fa fa-dashboard
 * @remark 用于展示当前系统中的统计数据、统计报表及重要实时数据
 */
class Dashboard extends Backend
{

    /**
     * 查看
     */
    public function index()
    {
        $model_user = new User();
        //全部用户
        //总用户数量
        $totaluser = $model_user->count();
        //今日注册
        $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
        $endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
        $usertoday = $model_user->where(['createtime'=>['between',[$beginToday,$endToday]]])->count();
        $this->view->assign([
            'totaluser'        => $totaluser,
            'totalviews'       => $usertoday,
            'totalorder'       => 32143,
            'totalorderamount' => 174800,
        ]);

        return $this->view->fetch();
    }

}
